<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SidebarSearchControl.ascx.cs" Inherits="Service_SidebarSearchControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    
</telerik:RadScriptManager>




<table cellpadding="10px">
    <tr>
        <td>
            <h3 style="font-style:italic; color:Fuchsia">You can choose quick search or advance search</h3>
        </td>
    </tr>
    <tr>
        <td>
            <b>Quick search :</b>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblValue" runat="server" />
            <telerik:RadComboBox ID="RadComboBox1" AllowCustomText="True" runat="server" Width="290px"
                                Height="200px" Filter="Contains" EmptyMessage="Search for Products..." ValidationGroup="1" 
                                DataSourceID="ObjectDataSource1" DataTextField="ProductName" DataValueField="ProductID" Skin="Sunset">                    
            </telerik:RadComboBox>
            &nbsp;&nbsp; &nbsp;<asp:Button ID="btnQuickSearch" runat="server" Text="Go" OnClick="btnQuickSearch_Click" />
            </td>
    </tr>
    <tr>
        <td>
            =========================================
        </td>
    </tr>
    <tr>
        <td>
            <b>Advance search :</b>
        </td>
    </tr>
    <tr>
        <td>
            Input into the textbox below to search by keyword
        </td>        
    </tr>
    <tr>
        <td>
            <i style="font-size:smaller">if you leave this textbox blank. Search feature will process by searching all product</i><br />
            <asp:TextBox ID="txtsearch" runat="server" Width="290px"></asp:TextBox><br />
            </td>        
    </tr>
    <tr>
        <td>
            <asp:CheckBox runat="server" ID="cbCategory" Text="Search By Category" AutoPostBack="True" 
                            OnCheckedChanged="cbCategory_CheckedChanged" Checked="false" /> 
        </td>
    </tr>
    <tr>
        <td>
            <telerik:RadComboBox ID="ddlSearchByCategory" runat="server" AllowCustomText="true" Width="290px"
                                Height="200px" EmptyMessage="Search by Category ..." Filter="Contains" Enabled="false"
                                DataSourceID="ObjectDataSourceCategory" DataTextField="CategoryName" DataValueField="CategoryID" Skin="Outlook" >
            
            </telerik:RadComboBox>
        </td>       
    </tr>
    <tr>
        <td>            
            <asp:CheckBox ID="cbSearchByPrice" runat="server" Text="Search By Price" AutoPostBack="True" 
                                OnCheckedChanged="cbSearchByPrice_CheckedChanged" Checked="false" />            
        </td>
       
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblPricefrom" runat="server" Text="Price from : " />     
            <telerik:RadNumericTextBox ID="txtPricefrom" runat="server" Width="50px" Type="Currency" Enabled="false" />
            <asp:Label ID="lblPriceto" runat="server" Text="Price to : " />
            <telerik:RadNumericTextBox ID="txtPriceto" runat="server" Width="50px" Type="Currency" Enabled="false" />
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblError" runat="server" Text="" ForeColor="red" Visible="false" />
        </td>
    </tr>
    <tr>
        <td>
            <asp:Button ID="btnSearch" runat="server" Text="Advance Search" OnClick="btnSearch_Click" />
        </td>
    </tr>
</table>

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetOnlyName"
    TypeName="Bll.ProductBll"></asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSourceCategory"     runat="server" SelectMethod="GetAll" TypeName="Bll.CategoryBll" />
